Restack native window after reparent put it on top
authorAlexander Larsson <alexl@redhat.com>
Mon, 19 Jan 2009 13:56:30 +0000 (14:56 +0100)
committerAlexander Larsson <alex@localhost.localdomain>
Thu, 2 Apr 2009 08:15:19 +0000 (10:15 +0200)
gdk/gdkwindow.c

index 1b61a153da2fd0934101626e42a364ceeda081ba..50cc817aa86e73b2c9b791c8fa318e548a55c403 100644 (file)
@@ -1162,7 +1162,23 @@ gdk_window_reparent (GdkWindow *window,
 
   if (do_reparent_to_impl)
     reparent_to_impl (private);
-  
+  else
+    {
+      GdkWindowObject *above;
+      GList listhead = {0};
+      
+      /* The reparent will have put the native window topmost in the native parent,
+       * which may be wrong wrt other native windows in the non-native hierarchy,
+       * so restack */
+      above = find_native_sibling_above (private->parent, private);
+      if (above)
+       {
+         listhead.data = window;
+         GDK_WINDOW_IMPL_GET_IFACE (private->impl)->restack_under ((GdkWindow *)above,
+                                                                   &listhead);
+       }
+    }
+
   if (show)
     gdk_window_show_unraised (window);
   else